package com.cms.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cms.dao.mapper.AdminUserMapper;
import com.cms.exception.SystemDBException;
import com.cms.model.TrAdminUser;
import com.cms.service.AdminUserService;

@Service
public class AdminUserServiceImpl implements AdminUserService {

	@Autowired
	private AdminUserMapper userMapper;  
	  
	@Override
	public TrAdminUser login(TrAdminUser user) {
		return userMapper.login(user);
	}

	@Override
	public void updateLoginDate(TrAdminUser user) {
		userMapper.updateLoginDate(user);
	}

	@Override
	public TrAdminUser getUserInfo(TrAdminUser user) {
		return userMapper.getUserInfo(user);
	}

	@Override
	public void register(TrAdminUser user) throws SystemDBException {
		userMapper.register(user);
	}

	@Override
	public void deleteUserInfo(TrAdminUser user) throws SystemDBException {
		userMapper.deleteUserInfo(user);
	}

	@Override
	public void updateUserInfo(TrAdminUser user) throws SystemDBException {
		userMapper.updateUserInfo(user);
	}
 
	@Override
	public void updateSelfUserInfo(TrAdminUser user) throws Exception {
		userMapper.updateSelfUserInfo(user);
	}
	
	 public void changeUserStatus(TrAdminUser user)throws SystemDBException
	 {
		 userMapper.changeUserStatus(user);
	 }

}
